<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let name="tW.Com";
        console.log(name.length);

        console.log(name.toUpperCase());
        console.log(name.toLowerCase());
        console.log(" sasdfaw ".trim());

     //字符串截取操作 slice substr substring
     //看看有什么不同
     let tw="唐玮真他妈的帅";
     console.log(tw.slice(0,2)); //唐玮，有截取的范围

      console.log(tw.substr(0,2));//唐玮

      console.log(tw.substring(0,2));

      //反向截取
      console.log(tw.slice(-3));//妈的帅
      console.log(tw.substr(-3));//妈的帅
      console.log(tw.substring(-3));//唐玮真他妈的帅 .subtring不支持倒着取

       console.log(tw.slice(-3,-1));//反正就是最后一个不取//妈的
  
     //repeat函数，
     console.log("*".repeat(5));
  </script>
</body>
</html>